package Pantallas;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.XYEdges;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.AbsoluteFieldManager;
import net.rim.device.api.ui.container.GridFieldManager;
import net.rim.device.api.ui.decor.BackgroundFactory;
import net.rim.device.api.ui.decor.Border;
import net.rim.device.api.ui.decor.BorderFactory;
import GUI.BitmapButtonField;
import GUI.ShortcutHandler;
import Main.MyApp;
/**
 * A class extending the MainScreen class, which provides default standard
 * behavior for BlackBerry GUI applications.
 */
public final class PantallaSesionRestaurada extends Pantalla
{	
	private int width;
	private int height;
    /**
     * Creates a new MyScreen object
     */
    public PantallaSesionRestaurada(){        
    	super();
    	this.addKeyListener (new ShortcutHandler());
        width  = MyApp.getWidth();
        height = MyApp.getHeight();
    	Bitmap bitmap = Bitmap.getBitmapResource("r1.png");
    	
        BitmapButtonField b  = new BitmapButtonField(bitmap, bitmap,0);
       
        LabelField b1 = new LabelField("Sesion Restaurada, por favor cerrar sesion  ");
        
        // Set up the 
		GridFieldManager gfm1 = new GridFieldManager(1, 2, GridFieldManager.FIXED_SIZE);
		gfm1.setColumnPadding(5);
	
		gfm1.setBorder(BorderFactory.createSimpleBorder( new XYEdges(0, 0, 0, 0),  Border.STYLE_DASHED)); 
		 
		// Size the columns of the GridFieldManager. Make sure to calculate 
		// for the padding applied to the columns. 
		int columnWidth = (width /2) - gfm1.getColumnPadding() + 175;
		
		int rowHeight   = (height /2) - gfm1.getColumnPadding() + 190;
		
		for(int i = 0; i < 1; i++) {
			gfm1.setColumnProperty(i, GridFieldManager.FIXED_SIZE, columnWidth);
			gfm1.setRowProperty(i, GridFieldManager.FIXED_SIZE, rowHeight);
		} 
		
		AbsoluteFieldManager afm = new AbsoluteFieldManager();
		// Populate the columns. 
		afm.add(b,110,80);
		afm.add(b1,150,100);
		
		gfm1.add(afm);
		gfm1.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("i4.jpg")));
		
		add(gfm1);
    }
    
}



	 

		


